﻿/* Tag class. */
var Comment = function () {

};
Comment.prototype.UpdateStatusComment = function (id, status) {
    var jsonStr = "{id:" + id + ",status:'" + status + "'}";
    $.ajax({
        type: "POST",
        url: "/Admin/WS/UpdateTag.asmx/UpdateComment",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: jsonStr,
        success: function (msg) {
            if (msg.d == 0) {
                alert('Error1!');
            }
            else {
                alert('Data was updated successfully');
                location.reload();
            }
            return true;
        },
        error: function () {
            alert("Error2!");
            return false;
        }
    });

};
Comment.prototype.DeleteComment = function (id) {
    var jsonStr = "{id:" + id + "}";
    $.ajax({
        type: "POST",
        url: "/Admin/WS/UpdateTag.asmx/DeleteComment",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        data: jsonStr,
        success: function (msg) {

            return msg.d;
        },
        error: function () {
            return -1;
        }
    });

};
/* Usage. */
